package com.easyCode.dataMock.dataGenerator;

import com.easyCode.dataMock.FieldMockInfo;

/**
 * @author 大忽悠
 * @create 2023/1/18 11:39
 */
public class IncreaseDataGenerator implements DataGenerator{
    /**
     * @param fieldMockInfo 字段信息
     * @return 返回模拟生成的data
     */
    @Override
    public String generator(FieldMockInfo fieldMockInfo) {
         int incrNum=fieldMockInfo.getExtra().length==2? Integer.parseInt(fieldMockInfo.getExtra()[1]) :1;
         fieldMockInfo.getExtra()[0]=String.valueOf(Integer.parseInt(fieldMockInfo.getExtra()[0])+incrNum);
         return fieldMockInfo.getExtra()[0];
    }
}
